package com.yunpeng.dishes.common.dtos.base;

import java.io.Serializable;
import java.util.Arrays;

/**
 * AopRequestObject
 * aop拦截的对象
 *
 * @author hemw.it
 * @date 2019/9/30 15:41
 */
public class AopRequestObject implements Serializable {

    /**
     * http请求url
     */
    private String requestUrl;

    /**
     * http请求方式
     */
    private String requestMethod;

    /**
     * 发起请求的ip
     */
    private String ipAddress;

    /**
     * 请求url映射的类和方法
     */
    private String mappingClassAndMethod;

    /**
     * 请求的参数名
     */
    private String[] parameterNames;

    /**
     * 请求的参数
     */
    private Object[] methodParameters;

    /**
     * 线程id
     */
    private long threadId;

    public AopRequestObject() {
    }

    public AopRequestObject(String requestUrl, String requestMethod, String ipAddress, String mappingClassAndMethod, String[] parameterNames, Object[] methodParameters, long threadId) {
        this.requestUrl = requestUrl;
        this.requestMethod = requestMethod;
        this.ipAddress = ipAddress;
        this.mappingClassAndMethod = mappingClassAndMethod;
        this.parameterNames = parameterNames;
        this.methodParameters = methodParameters;
        this.threadId = threadId;
    }

    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }

    public String getRequestMethod() {
        return requestMethod;
    }

    public void setRequestMethod(String requestMethod) {
        this.requestMethod = requestMethod;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getMappingClassAndMethod() {
        return mappingClassAndMethod;
    }

    public void setMappingClassAndMethod(String mappingClassAndMethod) {
        this.mappingClassAndMethod = mappingClassAndMethod;
    }

    public String[] getParameterNames() {
        return parameterNames;
    }

    public void setParameterNames(String[] parameterNames) {
        this.parameterNames = parameterNames;
    }

    public Object[] getMethodParameters() {
        return methodParameters;
    }

    public void setMethodParameters(Object[] methodParameters) {
        this.methodParameters = methodParameters;
    }

    public long getThreadId() {
        return threadId;
    }

    public void setThreadId(long threadId) {
        this.threadId = threadId;
    }


    @Override
    public String toString() {
        return "AopRequestObject{" +
                "threadId=" + threadId +
                ", requestUrl='" + requestUrl + '\'' +
                ", requestMethod='" + requestMethod + '\'' +
                ", ipAddress='" + ipAddress + '\'' +
                ", mappingClassAndMethod='" + mappingClassAndMethod + '\'' +
                ", parameterNames=" + Arrays.toString(parameterNames) +
                ", methodParameters=" + Arrays.toString(methodParameters) +
                '}';
    }
}
